package org.example.netty.Protobuf.client;

import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;

public class protobufClient {
    public static void main(String[]args)throws Exception {
        EventLoopGroup eventLoopGroup=new NioEventLoopGroup();
        try
        {
            Bootstrap bootstrap =new Bootstrap();
            bootstrap.group(eventLoopGroup).channel(NioSocketChannel.class)
                    .handler(new protobufClientInitializer());
            ChannelFuture channel = bootstrap.connect("localhost", 8999).sync();
            channel.channel().closeFuture().sync();

        }finally {
            eventLoopGroup.shutdownGracefully();
        }
    }
}
